package components.dialogs.effects
{
	import UIFree.uif_component;
	
	import classes.c_util;
	
	import components.dialogs.c_elementPropDlg;
	import components.dialogs.c_filterPropDlg;
	import components.dialogs.c_propertyDialog;
	import components.editor.c_baseElement;
	
	import flash.events.Event;
	import flash.filters.BlurFilter;
	import flash.filters.DropShadowFilter;
	
	public class c_Blur extends c_filterPropDlg {
		private static const MAXDISTANCE: Number = 50
		public function c_Blur(parent:uif_component, a_element:c_baseElement, a_title:String='', modal:Boolean=false, canClose:int=2) {
			super(parent, a_element, a_title, modal, canClose);
		}
		
		override protected function propertyList():Array {
			return [
				{
					title	: 'Размытие по горизонтали',
					type	: c_propertyDialog.PTYPE_NUMBER,
					value	: blurFilter.blurX/0.2
				},{
					title	: 'Размытие по вертикали',
					type	: c_propertyDialog.PTYPE_NUMBER,
					value	: blurFilter.blurY/0.2
				}
			]
		}
		
		protected function get blurFilter(): BlurFilter {
			return filter as BlurFilter;
		}
		
		override protected function filterClass():Class {
			return BlurFilter;
		}
		
		override protected function updateElement():void {
			blurFilter.blurX = values[0].value * 0.2;
			blurFilter.blurY = values[1].value * 0.2;
			super.updateElement();
		}		
	}
}